﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SoGame.Model;
using System.Windows.Input;
using GalaSoft.MvvmLight.Command;

namespace SoGame.ViewModels
{
    public class GamesViewModel : BaseViewModel
    {
        #region ICommand
        public ICommand GameSelection
        {
            get { return new RelayCommand<string>(ExecuteGameSelection, CanExecuteNavigateCommand); }
        }

        private bool _isSoSLAM;
        public bool IsSOSLAM
        {
            get { return _isSoSLAM; }
            set
            {
                _isSoSLAM = value;
                this.OnPropertyChanged(() => this.IsSOSLAM);
            }
        }

        private bool _isSoTANK;
        public bool IsSOTANK
        {
            get { return _isSoTANK; }
            set
            {
                _isSoTANK = value;
                this.OnPropertyChanged(() => this.IsSOTANK);
            }
        }

        public void ExecuteGameSelection(string command)
        {
            if (command == "SOSLAM")
            {
                IsSOSLAM = true;
                IsSOTANK = false;
            }
            else if (command == "SOTANK")
            {
                IsSOTANK = true;
                IsSOSLAM = false;
            }
        }

        public bool CanExecuteNavigateCommand(string param)
        {
            return true;
        }
        #endregion

        public GamesViewModel()
        {
            IsSOSLAM = true;
        }
    }
}
